<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增合同模板、常见问题关系')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-templateProblem-add">
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">合同模板：</label>
                <div class="col-sm-8">
                    <select  name="contractTemplateId" class="form-control m-b" required>
                        <option th:each="type : ${contractTemplateList}" th:text="${type.title}" th:value="${type.id}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">常见问题：</label>
                <div class="col-sm-8">
                    <select  name="commonProblemId" class="form-control m-b" required>
                        <option th:each="type : ${commonProblemList}" th:text="${type.title}" th:value="${type.id}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                    <input name="remark" class="form-control" type="text">
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "front/templateProblem"
        $("#form-templateProblem-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-templateProblem-add').serialize());
            }
        }

        $("input[name='checkTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>